package com.jxb.lession78.services.impl;

import com.jxb.lession78.dao.DeptMapper;
import com.jxb.lession78.entity.Dept;
import com.jxb.lession78.services.DeptServices;
import com.jxb.lession78.util.MybatisUtil;

import java.util.List;

public class DeptServicesImpl implements DeptServices {
    @Override
    public List<Dept> getAll() {
        try {
            DeptMapper mapper = MybatisUtil.getMapper(DeptMapper.class);
            List<Dept> list = mapper.getAll();
            MybatisUtil.commit();
            return list;
        } catch (Exception e) {
            e.printStackTrace();
        }
        MybatisUtil.rollback();
        return null;
    }
}
